<?php
//
/**
 * @param array $data
 * @param string $sc 排序标志 SORT_DESC 降序；SORT_ASC 升序
 * @param string $field 排序字段
 * @return array
 */
function array_sort($data=[],$sc ='',$field=''){
    //设置排序规则
    $sort = [
        'direction' => $sc,
        'field'     => $field,
    ];
    $arrSort = array();
    foreach($data AS $uniqid => $row){
        foreach($row AS $key=>$value){
            $arrSort[$key][$uniqid] = $value;
        }
    }
    if($sort['direction']){
        array_multisort($arrSort[$sort['field']], constant($sort['direction']), $data);
    }
    return $data;
}
